#include "def.h"
#include "Thread.h"
#include <stdio.h>
#include <string.h>

CThread::CThread()
{
    isIdle = false;
}

CThread::~CThread()
{

}

bool CThread::CreateCThread(void* (*start_address)(void*), void *arglist)
{
    int err = pthread_create(&threadID, 0, start_address, arglist);
    if (err!=0)
    {   
        printf("create thread failed for: %s\n", strerror(err));
        return false;
    }
    printf("create thread successfully\n");
    return true;
}

void CThread::ExitCThread()
{
    pthread_join(threadID, NULL);
    printf("thread %d destroy\n", threadID);
}



